package model

import "time"

type Order struct {
	Id          uint      `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	UserId      uint      `gorm:"column:user_id;type:bigint UNSIGNED;comment:用户id;not null;" json:"user_id"`                          // 用户id
	GoodId      uint      `gorm:"column:good_id;type:bigint UNSIGNED;comment:商品id;not null;" json:"good_id"`                          // 商品id
	OrderNumber string    `gorm:"column:order_number;type:varchar(255);comment:订单编号;not null;" json:"order_number"`                   // 订单编号
	CreatedAt   time.Time `gorm:"column:created_at;type:datetime;comment:创建时间;not null;default:CURRENT_TIMESTAMP;" json:"created_at"` // 创建时间
	UpdatedAt   time.Time `gorm:"column:updated_at;type:datetime;comment:修改时间;not null;default:CURRENT_TIMESTAMP;" json:"updated_at"` // 修改时间
	DeletedAt   time.Time `gorm:"column:deleted_at;type:datetime;comment:删除时间;default:NULL;" json:"deleted_at"`                       // 删除时间
}

func (Order) TableName() string {
	return "order"
}
